]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Remove unnecessary boolean cast
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 29 Jun 2019 22:33:20 +0000 (00:33 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 1 Jul 2019 21:09:49 +0000 (21:09 +0000)
In contexts where a statement (like if or while) expects a condition,
any expression will be implicitly cast to boolean already without
C-isms like double negation.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606

js/ui/status/keyboard.js

index ff2456a601889cadc5bfdf2cf32c70e89626e414..17abe8a9248f456b2f5d2b820d55331310aa1b82 100644 (file)
@@ -227,7 +227,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
 
         for (let i = 0; i < layouts.length && !!layouts[i]; i++) {
             let id = layouts[i];
-            if (!!variants[i])
+            if (variants[i])
                 id += '+' + variants[i];
             sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id: id });
         }